<?php
/**
 * Created by IntelliJ IDEA.
 * User: haoya_Coding_one
 * Date: 2019/3/23
 * Time: 14:44
 */

abstract class Model extends Sql implements Table
{
    function __construct(){
        //连接数据库
        $this->connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
        //数据库表名与类名一致
        $this->_table = $this->getTableName();
        $this->_primaryKey = $this->getPrimaryKeyName();
    }

    function __destruct(){
        $this->_dbHandle = null;
    }
}
